<?php
    error_reporting(E_ALL && ~E_NOTICE);

?>
<head>
    <title>DatingOnline | <?php echo $nav; ?></title>
		<link href="web/css/style.css" rel="stylesheet" type="text/css"  media="all" />
<!-- 		<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> -->
		<link rel="stylesheet" href="web/css/superfish.css" media="screen">
		<script src="web/js/jquery.js"></script>
		<script src="web/js/superfish.js"></script>
		<script type="text/javascript" src="web/js/move-top.js"></script>
		<script type="text/javascript" src="web/js/easing.js"></script>
		<script>
		(function($){ //create closure so we can safely use $ as alias for jQuery
			$(document).ready(function(){
				// initialise plugin
				var example = $('#example').superfish({
					//add options here if required
				});
				// buttons to demonstrate Superfish's public methods
				$('.destroy').on('click', function(){
					example.superfish('destroy');
				});
				$('.init').on('click', function(){
					example.superfish();
				});
				$('.open').on('click', function(){
					example.children('li:first').superfish('show');
				});
				$('.close').on('click', function(){
					example.children('li:first').superfish('hide');
				});
				//menu bar
                var menu = $("div#top-nav"),
                    pos = menu.offset();

                $(window).scroll(function(){

                    if($(this).scrollTop() > pos.top+menu.height() && menu.hasClass('default')){
                        menu.fadeOut('fast', function(){
                            $(this).removeClass('default').addClass('fixed').fadeIn('fast');

                        });
                    } else if($(this).scrollTop() <= pos.top && menu.hasClass('fixed')){
                        menu.fadeOut('fast', function(){
                            $(this).removeClass('fixed').addClass('default').fadeIn('fast');
                        });
                    }
                });
                //buttones
                $("#btnSgIn").bind('click', function (e){
                    e.preventDefault();
                    var $current=$(this);
                    $(".fade").fadeIn().load('web/singin.php');
                    return false;

                });
                //btn profile
                $("a.linkProfile").bind('click', function(e){
                    e.preventDefault();
                    var url = 'web/admin/'+$(this).attr('href');
                    $(".saContent").fadeOut('fast').load(url).fadeIn('slow');
                })




			});
		})(jQuery);
		</script>
		
		<script>
		jQuery(function(){
						jQuery('#camera_wrap_1').camera({
				height: '500',
				pagination: false,
				thumbnails: false,
				imagePath: '../images/'
			});

		});
		</script>

	</head>
	<body>
    <?php if(empty($_SESSION['loginId'])){?>
    <div class="loginForm">
    <div class="fade"></div>
    </div>
    <?php }?>
		<!---start-wrap-->
		<div class="wrap">
			<!---start-header-->
			<div class="header">
				<div class="logo">
					<a href="index.php"><img src="web/images/logo.png" title="naturex" /></a>
				</div>
				<div class="top-social-icons">
					<ul>
						<li><a class="icon1" href="#"> </a></li>
						<li><a class="icon2" href="#"> </a></li>
						<li><a class="icon3" href="#"> </a></li>
						<li><a class="icon4" href="#"> </a></li>
					</ul>
				</div>
				<div class="clear"> </div>
			</div>
			<div class="clear"> </div>
			<!---End-header-->
			<!---start-top-nav-->
			<div class="top-nav default" id="top-nav">
						<ul class="sf-menu sf-menu2" id="example">
							<li  class="current home">
							<a href="index.php"></a>
                                <script type="text/javascript" >
                                    $(".home a").bind('click', function(e){
                                        e.preventDefault();
                                        $("body").load("web/index.php");
                                    })
                                </script>
						</li>
						<li class="active">
                            <?php if(empty($_SESSION['LoginData'])){?>
							<a href="about.php">About</a>

                            <?php }else {
                                if($_SESSION['LoginData']['permit']==1){
                                    $nav_profile='admin.php';
                                }else
                                    $nav_profile='profile.php';
                            ?>
                             <a class="link2admin" id="link2admin" href="<?php echo $nav_profile ?>"><?php echo $_SESSION['LoginData']['fstName'];?></a>
                            <?php }?>
						</li>
						<li>
							<a class="linkProfile" href="userList.php">Tài khoản</a>

						</li>
                            <?php
                            if(!empty($_SESSION['LoginData'])){
                            ?>
						<li>
							<a class="linkProfile" href="questionList.php">Câu hỏi</a>
						</li>
                            <?php }?>

                        <?php
                        if($_SESSION['LoginData']['permit']==1){?>
                            <li>
                                <a id="btnSgOut" href="web/singout.php">Đăng xuất </a>
                            </li>
                            <li id="sms" class="sum current"><span class="number" id="1">123</span> </li>
                            <li id="quest" class="sum current"><span class="number" id="2"></span> </li>
                            <script type="text/javascript">


					            //sum notufy
					                $("span.number").each(function(){
					                	$cur=$(this);
					                	id=$cur.attr('id');
					                	vl=$cur.text().trim();
					                	if(vl){
					                		$("span.number#"+id).addClass('on');
					                	}

					                })
					            // end sum notify
							</script>
                        <?php  } ?>

						<div class="clear"> </div>
					</ul>
					</div>
					<div class="clear"> </div>
				</div>
				<!---End-header-->

